import request from '@/utils/request'

// 查询【请填写功能名称】列表
export function listManagement(query) {
  return request({
    url: '/business/stock/list',
    method: 'get',
    params: query
  })
}

// 查询【请填写功能名称】详细
export function getManagement(id) {
  return request({
    url: '/business/stock/' + id,
    method: 'get'
  })
}

// 新增【请填写功能名称】
export function addManagement(data) {
  return request({
    url: '/business/stock',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function supplierUpdate(data) {
  return request({
    url: '/business/stock/supplierUpdate',
    method: 'POST',
    data: data
  })
}

// 编辑操作
export function update(data) {
  return request({
    url: '/business/stock/update',
    method: 'POST',
    data: data
  })
}

// 删除【请填写功能名称】
export function delManagement(id) {
  return request({
    url: '/business/stock/' + id,
    method: 'delete'
  })
}

//查询类目下包含的数据
export function unboundPhonesByCategory(categoryId) {
  return request({
    url: '/business/phone/unboundPhonesByCategory/' + categoryId,
    method: 'get'
  })
}

//提号
export function notation(data) {
  return request({
    url: '/business/stock/notation',
    method: 'post',
    data
  })
}

// 修改金额
export function updatePercentage(percentage, status, ids) {
  return request({
    url: `/business/stock/updatePercentage/${ids}`,
    method: 'get',
    params: {
      percentage: percentage,
      status: status
    }
  })
}

export function pendings(ids) {
  return request({
    url: `/business/stock/pendings/${ids}`,
    method: 'get'
  })
}

//订单提交
export function submitOrder(data) {
  return request({
    url: '/business/stock/submitorder',
    method: 'post',
    data
  })
}

//获取供应商
export function getSupplier(data) {
  return request({
    url: '/business/stock/getSupplier',
    method: 'get'
  })
}

// 根据营地id获取皮肤
export function getSkin(data) {
  return request({
    url: '/system/api/getWuserZpf/' + data,
    method: 'get'
  })
}
// //图片上传
// export function upload(data) {
//   return request({
//     url: '/common/upload',
//     method: 'post',
//     data
//   })
// }


